var express = require('express');
var router = express.Router();
var jwt = require('jsonwebtoken');
var config = require('../config.json');


var secretOrPrivateKey = config.jwt.secretOrPrivateKey
/* GET home page. */
router.get('/', function(req, res, next) {

	var token = jwt.sign({
		name: "sadsda",
		data: "sadad"
	}, secretOrPrivateKey, {
		expiresIn: 60 * 1
	})

	res.send({
		code: 200,
		token: token
	})
});

router.get('/xxoo', function(req, res, next) {

	res.send({
		code: 200,
		token: "helloworld"
	})
});

module.exports = router;